{template header}
<script>
$(document).ready(function() {

//选择一级区域
$('#cateid').change(function(){
	$("#select2").html('<img src="'+siteUrl+'public/images/loading.gif" />');
	var cateid = $(this).children('option:selected').val();  //弹出select的值
	
	if(cateid==0){
		$("#select2").html('');
		$("#select3").html('');
	}else{
		$("#select3").html('');
		$.ajax({
			type: "GET",
			url:  "{SITE_URL}index.php?app=study&ac=cate&ts=two&cateid="+cateid,
			success: function(msg){
				$("#select2").html(msg);
				
				//选择二级区域
				$('#cateid2').change(function(){
					$("#select3").html('<img src="'+siteUrl+'public/images/loading.gif" />');
					var cateid2 = $(this).children('option:selected').val();  //弹出select的值
					
					if(cateid2 == 0){
						$("#select3").html('');
					}else{
					
						//ajax
						$.ajax({
							type: "GET",
							url:  "{SITE_URL}index.php?app=study&ac=cate&ts=three&cateid2="+cateid2,
							success: function(msg){
								$('#select3').html(msg);
							}
						});
					
					}

				});
				
			}
		});
	
	}
	
});

});
</script>

<div class="container">
<div class="mc">

<div class="bbox pd10">
<div class="bc onecate">
<ul>
<li><a href="{tsUrl('study')}">首页</a></li>
{loop $arrOneCate $key $item}
<li>
<a href="{tsUrl('study','cate',array('id'=>$item['cateid']))}">{$item['catename']}</a>
</li>
{/loop}
<li class="create"><a class="select" href="{tsUrl('study','create')}">创建课程</a></li>
</ul>
</div>
</div>

    <div class="panel panel-default">
        <div class="panel-heading">创建课程</div>
        <div class="panel-body">


            <form class="form-horizontal" method="post" action="{SITE_URL}index.php?app=study&ac=create&ts=do"  enctype="multipart/form-data">

                <div class="form-group">
                    <label class="col-sm-2 control-label">课程标题：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="studyname" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">课程介绍：</label>
                    <div class="col-sm-8">
                        <div id="tseditor"></div>
                        <div style="display: none;"><textarea name="studydesc" ></textarea>

                        </div>
                        <!--<textarea name="content" id="tseditor"></textarea>-->

                    </div>
                </div>


                <div class="form-group">
                    <label class="col-sm-2 control-label">课程价格：</label>
                    <div class="col-sm-8">
                        <input class="form-control" type="text" name="price" value="0" />
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">科目分类：</label>
                    <div class="col-sm-8">

                        <select  id="cateid" name="cateid">
                            <option value="0">请选择一级分类</option>
                            {loop $arrCates $key $item}
                            <option value="{$item['cateid']}">{$item['catename']}</option>
                            {/loop}
                        </select>

                        <span id="select2"></span>
                        <span id="select3"></span>

                    </div>
                </div>


                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-success btn-lg">创建新课程</button>
                    </div>
                </div>


            </form>



</div>

</div>

</div>
</div>

{php doAction('tseditor')}
{template footer}